import request from '@/utils/request'

export function List(params) {
  return request({
    url: `/Home/DeviceMaintenanceInfo/Type=${params.Type}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function WorkOrderInfoType(params) {
  return request({
    url: `/Home/WorkOrderInfo/Type=${params.Type}Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function DeviceState(params) {
  return request({
    url: `/Home/DeviceState/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function DeviceStatistics(params) {
  return request({
    url: `/Home/DeviceStatistics/`,
    method: 'get',
    params,
  })
}

export function WorkOrderInfo(params) {
  return request({
    url: `/Home/WorkOrderInfo/Type=${params.Type}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function DeviceStateType(params) {
  return request({
    url: `/Home/DeviceState/Type=${params.Type}Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function DeviceRunningInfo(params) {
  return request({
    url: `/Home/DeviceRunningInfo/Type=${params.Type}&Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function AlarmInfoList(params) {
  return request({
    url: `/System/AlarmInfoList/`,
    method: 'get',
    params,
  })
}

export function GetAllDevice(params) {
  return request({
    url: `/ManualControl/Home/GetAllDevice/LineName=${params.LineName}`,
    method: 'get',
    params,
  })
}

export function DeviceUseRequest(data) {
  return request({
    url: `/ManualControl/Home/DeviceUseRequest/DeviceId=${data.DeviceId}`,
    method: 'post',
    data,
  })
}

export function DeviceFreeRequest(data) {
  return request({
    url: `/ManualControl/Home/DeviceFreeRequest/DeviceId=${data.DeviceId}`,
    method: 'post',
    data,
  })
}

export function DeviceCmdExec(data) {
  return request({
    url: `/ManualControl/Home/DeviceCmdExec/DeviceId=${data.DeviceId}`,
    method: 'post',
    data,
  })
}

export function RobotCmdExec(data) {
  return request({
    url: `/ManualControl/Home/RobotCmdExec/DeviceId=${data.DeviceId}&Cmd=${data.Cmd}&Gripper=${data.Gripper}&DevLoc=${data.DevLoc}&HouseLoc=${data.HouseLoc}`,
    method: 'post',
    data,
  })
}

export function RobotTakeInfo(params) {
  return request({
    url: `/ManualControl/Home/RobotTakeInfo/`,
    method: 'get',
    params,
  })
}

export function RobotPutInfo(params) {
  return request({
    url: `/ManualControl/Home/RobotPutInfo/PartId=${params.PartId}`,
    method: 'get',
    params,
  })
}

export function DeviceMachineCmdExec(data) {
  return request({
    url: `/ManualControl/Home/DeviceMachineCmdExec/DeviceId=${data.DeviceId}`,
    method: 'post',
    data,
  })
}

export function ManualControlInfo(params) {
  return request({
    url: `/ManualControl/Info/`,
    method: 'get',
    params,
  })
}
